import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: "/page",
      component: () => import('@/views/page'),
      children: [
        {
          path: '/',
          component: () => import('@/views/main'),
        },
        {
          path: 'main',
          component: () => import('@/views/main'),
        },
        {
          path: 'device_info',
          component: () => import('@/components/device_info.vue'),
        },
        {
          path: 'userinfo',
          component: () => import('@/components/userinfo.vue'),
        },
        {
          path: 'add_device',
          component: () => import('@/components/add_device'),
        },
        {
          path: 'adduser',
          component: () => import('@/components/adduser'),
        },
        {
          path: 'm_device',
          component: () => import('@/components/m_device'),
        },
        {
          path: 'm_userinfo',
          component: () => import('@/components/m_userinfo'),
        },
        {
          path: 'systeminfo',
          component: () => import('@/components/systeminfo'),
        },
        {
          path: 'systemrun',
          component: () => import('@/components/systemrun'),
        },
        {
          path: 'systemupdate',
          component: () => import('@/components/systemupdate'),
        },
        {
          path: 'analyzeinfo',
          component: () => import('@/components/analyzeinfo'),
        },
        {
          path: 'aiman',
          component: () => import('@/components/aiman'),
        },
        {
          path: 'taskman',
          component: () => import('@/components/taskman'),
        },
        {
          path: 'errorinfo',
          component: () => import('@/components/errorinfo'),
        },
        {
          path: 'errorsetting',
          component: () => import('@/components/errorsetting'),
        },
        {
          path: 'getinfo',
          name:'getinfo',
          component: () => import('@/components/getinfo'),
          children: [
            {
              path: '/',
              component: () => import('@/components/getinfodeviceA'),
            },
            {
              path: 'getinfodeviceA',
              component: () => import('@/components/getinfodeviceA'),
            },
            {
              path: 'getinfodeviceB',
              component: () => import('@/components/getinfodeviceB'),
            },

            {
              path: 'getinfodeviceC',
              component: () => import('@/components/getinfodeviceC'),
            },
            {
              path: 'getinfodeviceD',
              component: () => import('@/components/getinfodeviceD'),
            },
          ]
        },
      ]
    },
    {
      path: "/",
      component: () => import("@/views/login")
    },
    {
      path: "/login",
      component: () => import('@/views/login'),
    }
  ]
})
